package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 查询菜品是否在套餐中
     * @param dishIds
     * @return
     */
    List<Long> getSetmeslDishIds(List<Long> dishIds);


    /**
     * 向套餐中添加菜品
     * @param dishes
     */
    void insertBatchDish(List<SetmealDish> dishes);

    /**
     * 根据id获取套餐菜品信息
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getSetmeslDishId(Long id);

    /**
     * 根据id删除菜品
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteSetmealDish(Long setmealId);

    /**
     * 根据ids集合删除菜品
     * @param setmeslDishIds
     */
    void deleteSetmealDishs(List<Long> setmeslDishIds);
}
